package com.lyxs916.appbaselibrary.core.iview;

import rx.Subscription;
import rx.subscriptions.CompositeSubscription;


/**
 * activity and fragment 共用属性
 */
public interface IActivityAndFragment {

    /**
     * 添加一个订阅
     *
     * @param subscription
     */
    void addSubscription(Subscription subscription);

    /**
     * CompositeSubscription来持有所有的Subscriptions，然后在onDestroy()或者onDestroyView()里取消所有的订阅。
     *
     * @return
     */
    CompositeSubscription getCompositeSubscription();


}
